import { Sequelize } from "sequelize";

export const sequelize =new Sequelize({
    dialect:"sqlite",
    storage:"./db.db"
    
})

export const sync = async ()=>{
    let {Blog} =await import ('../model/Blog.js')
    await sequelize.sync({force:true})
    let arr=[
        {
            title:"红红火火恍恍惚惚",
            author:"123456"
        },
        {
            title:"开开心心",
            author:"123"
        },
        {
            title:"高高兴兴",
            author:"123456"
        }
    ]
    Blog.bulkCreate(arr)
}